import { Controller, Get, Req } from '@nestjs/common';
import { AppService } from '../services/app.service';
import { UserDTO } from '@/dtos/user.dto';
import { FastifyRequest } from 'fastify';

interface Req extends FastifyRequest {
  user: Omit<UserDTO, "password">;
}

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  getHello(@Req() request: Req): string {
    const { user } = request;
    return this.appService.getHello(user);
  }
}
